<div class="syntax"><pre><span class="c"># myexception.py</span>

<span class="kn">import</span> <span class="nn">exceptions</span>
<span class="k">class</span> <span class="nc">Expletive</span><span class="p">(</span><span class="n">exceptions</span><span class="o">.</span><span class="n">Exception</span><span class="p">):</span>
    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">return</span>
		
    <span class="k">def</span> <span class="nf">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">return</span> <span class="s">&quot;Oh, expletive!&quot;</span>
	
<span class="k">def</span> <span class="nf">main</span><span class="p">():</span>
    <span class="k">raise</span> <span class="n">Expletive</span>
	
<span class="k">if</span> <span class="n">__name__</span><span class="o">==</span><span class="s">&quot;__main__&quot;</span><span class="p">:</span>
    <span class="k">try</span><span class="p">:</span>
	<span class="n">main</span><span class="p">()</span>
    <span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
        <span class="k">print</span> <span class="s">&quot;Unable to import something...&quot;</span>
    <span class="k">except</span> <span class="ne">Exception</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span>
	<span class="k">raise</span> <span class="n">e</span>
</pre></div>
